import request from '@/utils/request'

// 登录参数
interface LoginPrams {
  nickname: string
  /** 密码需md5加密 */
  password: string
  /** 验证码 */
  verificationcode: string
  /** 验证码的key */
  fingerprint: string
}
// 登录返回值
interface LoginResponse {
  token: string
  lastLogin: {
    createtime: string
    id: number
    ip: string
    logtype: number
    msg: string
    userid: number
  }
  userInfo: {
    fullname: string
    id: number
    isadmin: number
    nickname: string
    password: string
  }
}
// 登录接口
export const login = (params: LoginPrams) => request<LoginResponse>({ url: '/auth/login', params, notUseToken: true })
